package com.whfc.common.enums;

/**
 * @Description: 安全帽状态枚举(1 - 正常佩戴 2 - 未佩戴 3 - 跌倒 4 - 坠落 5 - 休眠 6 - 计算错误)
 * @author: xugcheng
 * @version: 1.0
 * @date: 2019/7/22 11:47
 */
public enum HelmetState {

    NORMAL(1, "正常佩戴"),

    DOFF(2, "未佩戴"),

    FALL(3, "跌倒"),

    DROP(4, "坠落"),

    SLEEP(5, "休眠"),

    ERROR(6, "错误");

    private Integer value;

    private String desc;

    HelmetState(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static HelmetState parseByValue(Integer value) {
        HelmetState helmetState = null;
        switch (value) {
            case 1:
                helmetState = NORMAL;
                break;
            case 2:
                helmetState = DOFF;
                break;
            case 3:
                helmetState = FALL;
                break;
            case 4:
                helmetState = DROP;
                break;
            case 5:
                helmetState = SLEEP;
                break;
            case 6:
                helmetState = ERROR;
                break;
            default:
                break;
        }
        return helmetState;
    }

}
